//
//  CHQRViewController.swift
//  bridging_js
//
//  Created by cyptt on 2021/9/6.
//

import UIKit
import CHSimpleUI
class CHQRViewController: UIViewController {

    var scanReulstB:((_ result:String) ->Void)? //视频回调
    override func viewDidLoad() {
        super.viewDidLoad()

        self.view.backgroundColor = UIColor.black
        let qrCodeView:CHQRCodeView = CHQRCodeView.init(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height));
        self.view.addSubview(qrCodeView)
   
        qrCodeView.startScaning { (result) in
          qrCodeView.stopScanning()
            if(self.scanReulstB != nil) {
               
                self.scanReulstB!(result)
            }
        };

    }
    
 
    /**
     扫码结果
     */
    func scanResult(reulstB:@escaping ((_ String:String)->Void)){
        
        self.scanReulstB = reulstB
    }
    
    
    
}
